import "./styles/normalize.css";
import React from "react";
import ReactDOM from "react-dom/client";
import { Provider } from "react-redux";
import { ConfigProvider } from "antd";
import zhCN from "antd/locale/zh_CN";


import reportWebVitals from "./reportWebVitals";
import { store } from "./models/store";
import { appRegister,onGlobalStateChange ,setGlobalState,offGlobalStateChange} from "./models/micro/microSlice";
import App from "./App";

store.dispatch(appRegister());
store.dispatch(onGlobalStateChange());
store.dispatch(setGlobalState());
store.dispatch(offGlobalStateChange());


function bootstrap() {
  const root = ReactDOM.createRoot(
    document.getElementById("root") as HTMLElement
  );
  root.render(
    <ConfigProvider locale={zhCN}>
      <React.StrictMode>
        <Provider store={store}>
          <App />
        </Provider>
      </React.StrictMode>
    </ConfigProvider>
  );
}
bootstrap();
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
